<include file="./Application/Home/View/Home/top.html"/>
<div class="contain" style="text-align: right;text-align: right; height: 30px; line-height: 40px; padding-right: 20px;">
    合计：<span id="allPrice" style="color:#f00;font-size: 16px;
    margin: 0 5px;">1900.00</span>元
</div>
<div class="contain layui-form">
    <table class="layui-table">
        <colgroup>
            <col width="150"/>
            <col/>
            <col width="200"/>
            <col width="200"/>
            <col width="150"/>
            <col width="150"/>
        </colgroup>
        <thead>
        <tr>
            <th class="text_c">姓名</th>
            <th class="text_c">治疗时间</th>
            <th class="text_c">治疗项目</th>
            <th class="text_c">治疗次数</th>
            <th class="text_c">单价</th>
            <th class="text_c">总价</th>
        </tr>
        </thead>
        <tbody>
        <volist name="list" id="data">
            <tr>
                <td class="text_c">{$data.name}</td>
                <td class="text_c">{$data.time}</td>
                <td class="text_c">{$data.xname}</td>
                <td class="text_c">{$data.cishu}</td>
                <td class="text_c">{$data.xprice}</td>
                <td class="text_c" _name="allPrice">{$data['xprice'] * $data['cishu']}</td>
            </tr>
        </volist>
        </tbody>
    </table>
</div>
<script src="__PUBLIC__/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery.js"></script>
<script>

    $(function(){
        var len = $('[_name="allPrice"]').length;
        var allPrice = 0;
        for(var i = 0; i < len; i++){
            allPrice += parseFloat($('[_name="allPrice"]').eq(i).html());
        }
      
        $('#allPrice').html(allPrice);
    })

</script>